home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / directory editor (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  8KB  |  279 lines

  1. 1 a$="":iffl=0thengosub60000
  2. 3 goto50:rem"[141][147]           software by bull[141]
  3. 7 [128]:[143]"
  4. 10 :      directory editor
  5. 11 :
  6. 15 :             by
  7. 19 :          dick bull                            738 pueblo ave
  8. 23 :       napa, ca. 94558
  9. 27 :
  10. 32 rem"[141]     'list 50 -'  to see program[141]"(NULL)
  11. 50 iffl=0thenfl=1:load"input 30.o",8,1
  12. 52 a$="":poke53281,1:print"[147][144]";chr$(14)
  13. 55 print"           [196]irectory edit[146]"
  14. 60 print"  [212]his program will do the following:
  15. 65 [153]"  1:wait (NULL)(NULL)(NULL)valclosedirectory listings
  16. 70 print"  2:[146] [205]ake a place in the directory"
  17. 75 print"     where ever you want, so that the        next";
  18. 80 print" saved file will appear there"
  19. 85 print"  3:[146] [205]ake a mark (------------)"
  20. 90 print"     [each will be different -- 45 max]
  21. 95 [153]"     any place in the directory"
  22. 100 [153]"  4:wait (NULL)len(NULL)atn(NULL)lenleft$ and (NULL)val(NULL)atn(NULL)val files
  23. 105 print"     [rename that mystery file]
  24. 110 [153]"     [scratch '' or',' etc.]
  25. 115 print"  5:[146] [204][207][195][203]/ [213][206][204][207][195][203] files;
  26. 120 [153]"     locked files can't be scratched.        and are printed reversed
  27. 125 print"     selected locked files will be           unlocked. ";
  28. 130 print"selected unlocked files       will be locked
  29. 135 :
  30. 140 [134]b(18),f$(144):[151]198,0
  31. 145 z$[178]""
  32. 150 b(1)[178]1:b(2)[178]4:b(3)[178]7:b(4)[178]10:b(5)[178]13:b(6)[178]16:b(7)[178]2:b(8)[178]5:b(9)[178]8:b(10)[178]11
  33. 155 b(11)[178]14:b(12)[178]17:b(13)[178]3:b(14)[178]6:b(15)[178]9:b(16)[178]12:b(17)[178]15:b(18)[178]18
  34. 160 [153],"  press a key":[141]1245
  35. 165 [153]"load(NULL)hen you are finished it will rewrite   the directory on the disk.
  36. 170 print"[214]alidate[146] the disk if desired. [196]o not useon disks with random files
  37. 175 [153]"(NULL)oft-write protectwait the disk if selected will act like the write ";
  38. 180 [153]"protect tab on adisk. right$t works by giving a dos mismatch
  39. 185 print"error on attempting to write to the disk
  40. 190 [153]"peekoth hard and soft write protected disks";
  41. 195 [153]"will be checked for at the start of the program and removed if desired.
  42. 200 print"[208]lace the disk to edit in the drive and "
  43. 202 print"            press a key."
  44. 205 gosub1245
  45. 210 printchr$(142)"[147]";
  46. 215 open1,8,15:print#1,"i"
  47. 220 open2,8,2,"#":gosub790
  48. 225 open3,8,3,"0:tz,u,w":gosub790
  49. 230 ifer<>0thenclose2:close3:close1:goto210
  50. 235 close3:print#1,"s0:tz"
  51. 240 n=1:z=1:t=18:s=1:hi$="":k=1
  52. 245 fori=1to11:hi$=hi$+chr$(0):next
  53. 250 k$=chr$(131)+chr$(18)+chr$(0):da$="----------------"+hi$:fi$=" "
  54. 255 print"reading files. please wait
  55. 260 [152]1,"u1 2 0";t;s
  56. 265 [161]#2,t$,s$
  57. 270 t[178][198](t$[170][199](0)):s[178][198](s$[170][199](0))
  58. 275 [139]t[177]0[167]z[178]z[170]1
  59. 280 bp[178]2
  60. 285 [129]i[178]1[164]8:[153]""z;i
  61. 290 [152]1,"b-p 2";bp
  62. 295 [158]828,2:[139]bp[179]226[167]bp[178]bp[170]32
  63. 300 [139][198]([200](a$,1))[179][177]0[167]f$(n)[178]a$:n[178]n[170]1:[130]
  64. 305 [139][198]([200](a$,1))[178]0[167][130]
  65. 310 [139]t[179][177]0[167][137]260
  66. 315 za[178]z:na[178]n
  67. 320 [129]r[178]1[164]n:[139][202](f$(r),4,1)[179][177]"-"[167]332
  68. 325 [139][202](f$(r),5,1)[178]"-"[176][202](f$(r),6,1)[178]"-"[167]da[178]da[170]1
  69. 332 [130]r
  70. 335 :
  71. 340 [143] directory listing
  72. 345 :
  73. 350 [153]"load           directory editwait"
  74. 355 [129]i[178]k[164]k[170]17
  75. 360 [139]i[177]n[171]1[167]380
  76. 365 [139][198](f$(i))[175]64[167][153]"";
  77. 370 i$[178][196](i):i$[178][201]([196](i),[195](i$)[171]1)[170]" "
  78. 375 [153]"stop"i$;:[151]212,128:[153][202](f$(i),4,16):[151]212,0
  79. 380 [139]i[170]18[177]n[171]1[167]395
  80. 385 [139][198](f$(i[170]18)) [175]64[167][153]"";
  81. 390 [153][163]19)"onstop";i[170]18;"stop";:[151]212,128:[153][202](f$(i[170]18),4,16):[151]212,0
  82. 395 [130]:[151]212,0
  83. 400 [153]z$"f1wait insert space     f2wait remove spaces
  84. 405 print"f3[146] move entries     f4[146] lock/unlock
  85. 410 [153]"f5wait add -------wait      _wait  write or exit
  86. 415 print"f7[146] rename file      f8[146] delete files
  87. 420 [153]"crsr up/downwait page if listing >36 ";
  88. 425 [153][199](142);
  89. 430 [141]1245
  90. 435 [139]a$[178]"_"[167]690
  91. 440 [129]t[178]1[164]9:[139][202]("inputgotodimrunreadletrestoreon",t,1)[178]a$[167]450
  92. 445 [130]:[137]425
  93. 450 [145]t[141]490,665,535,915,605,855,740,455,465 :[137]350
  94. 455 k[178]k[171]10:[139]k[178][179]0[167]k[178]1:[143] csr-up
  95. 460 [142]
  96. 465 [139]k[170]34[179]n[167]k[178]k[170]10:[143] crsr-down
  97. 470 [142]
  98. 475 :
  99. 480 :[143] insert empty file
  100. 485 :
  101. 490 q$[178]" space above":[141]945
  102. 495 [139]a[178][179]0[167][142]
  103. 500 [129]i[178]n[164]a[170]1[169][171]1
  104. 505 f$(i)[178]f$(i[171]1):[130]:n[178]n[170]1:f$(a)[178]""
  105. 510 [129]i[178]1[164]30:f$(a)[178]f$(a)[170][199](0):[130]
  106. 515 [142]
  107. 520 :
  108. 525 :[143] move entries
  109. 530 :
  110. 535 q$[178]" move":[141]945
  111. 540 [139]a[178][179]0[167][142]
  112. 545 [139]a[177]n[171]1[167]535
  113. 550 b[178]0:[153]z$;:[133]" above which file   ";b
  114. 555 [139]b[178][179]0[167]585
  115. 560 [139]b[177]n[167]550
  116. 565 [139]a[178]b[167]585
  117. 570 fh$[178]f$(a)
  118. 575 [139]a[177]b[167] [129] i[178]a [164] b[170]1 [169][171]1:f$(i)[178]f$(i[171]1):[130]:f$(b)[178]fh$
  119. 580 [139]b[177]a[167] [129] i[178]a [164] b[171]1 :f$(i)[178]f$(i[170]1):[130]:f$(b[171]1)[178]fh$
  120. 585 [142]
  121. 590 :
  122. 595 [143] add dashes
  123. 600 :
  124. 605 q$[178]" dashes above":[141]945
  125. 610 [139]a[178][179]0[167][142]
  126. 615 [129]i[178]n[164]a[170]1[169][171]1
  127. 620 f$(i)[178]f$(i[171]1):[130]:n[178]n[170]1:da[178]da[170]1
  128. 625 f$(a)[178]k$[170][200](da$,da)[170]fi$[170][202](da$,da[170]1,15[171]da)[170]hi$:[143] right$ wont work
  129. 630 [139]da[177]14[175]fi$[178]" "[167]fi$[178]"=":da[178]0
  130. 635 [139]da[177]14[175]fi$[178]"="[167]fi$[178]"+":da[178]0
  131. 640 [139]da[177]14[167]da[178]0
  132. 645 [142]
  133. 650 :
  134. 655 :[143] remove empty files
  135. 660 :
  136. 665 [129]i[178]1[164]n[171]1:[139]([198]([200](f$(i),1)))[178]0[167][137]680
  137. 670 [130]
  138. 675 [142]
  139. 680 [129]r[178]i[164]n[171]1:f$(r)[178]f$(r[170]1):[130]:n[178]n[171]1:[137]665
  140. 685 :
  141. 690 [153]"load   ready to write new directory...
  142. 695 print"     1 to return to editing"
  143. 700 print"     2 to rewrite directory"
  144. 705 print"     0 to end without changing                 old directory
  145. 710 [153]"            press key
  146. 715 gosub1245:a=val(a$):ifa<0ora>2then715
  147. 720 ona+1goto1215,350,965:goto715
  148. 725 :
  149. 730 rem delete entry
  150. 735 :
  151. 740 q$=" delete":gosub945
  152. 745 ifa=<0thenreturn
  153. 750 ifasc(f$(a))and64thenprint"[145]  locked file        ":gosub1245:goto785
  154. 755 print"[147]delete ";mid$(f$(a),4,16)
  155. 760 print"are you sure y/n":gosub1245
  156. 765 ifa$<>"y"anda$<>"[217]"then785
  157. 770 print#1,"s0:"mid$(f$(a),4,16):print"working
  158. 775 [141]790:[139]er[177]1 [167] [137]785
  159. 780 [129]r[178]a[164]n[171]1:f$(r)[178]f$(r[170]1):[130]:n[178]n[171]1
  160. 785 [142]
  161. 790 [132]1,er,er$,et,es:[139]er[178]0[167]805
  162. 795 [153]""er;er$;et;es:[139]er[178]73 [167]810 
  163. 800 [153],"press any key to cont":[141]1245
  164. 805 [142]
  165. 810 [153]"disk is software locked":[133]"do you want to unlock it";a$
  166. 815 [139]a$[178]"y"[167] [141]1265:[137]805
  167. 820 [139]a$[179][177]"n"[167]810
  168. 825 [153]"loadthis program is used to rewrite the     directory.
  169. 830 print"write protection must be removed for it to work correctly.
  170. 835 [153]"check disk and rerun the program"
  171. 840 [160]2:[160]1:[128]
  172. 845 :
  173. 850 [143] [210][197][206][193][205][197]
  174. 855 q$[178]" rename":[141]945
  175. 860 [139]a[178][179]0[167]895
  176. 865 [153]"loadrename ";[202](f$(a),4,16)
  177. 870 a$[178]"":[133]"new name";a$:[139]a$[178]""[167]895
  178. 875 [139][195](a$)[177]16[167][153]"too long":[137]870
  179. 880 a$[178][200](a$[170]"closeclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclose",16)
  180. 885 f$(a)[178][200](f$(a),3)[170]a$[170][202](f$(a),20,11)
  181. 890 [153][195](f$(a))
  182. 895 [142]
  183. 900 :
  184. 905 [143] lock/unlock
  185. 910 :
  186. 915 q$[178]" lock/unlock":[141]945
  187. 920 [139]a[178][179]0[167]955
  188. 925 b[178][198]([200](f$(a),1)):[139]b[175]64[167]b[178]b[175]191:[137]935
  189. 930 b[178]b[176]64
  190. 935 f$(a)[178][199](b)[170][202](f$(a),2,29)
  191. 940 [142]
  192. 945 a[178]0:[153]""z$;q$;" which filestop";:[133]a
  193. 950 [139]a[177]n[167]945
  194. 955 [142]
  195. 960 :
  196. 965 [153]"on         writing new directory
  197. 970 print"please do not remove disk until red"
  198. 975 print"light is out. thank you
  199. 980 [137]985
  200. 985 a$[178]""
  201. 990 [129]i[178]1[164]30:a$[17